package com.crealth.memcached;

import com.crealth.Config;
import com.danga.MemCached.MemCachedClient;
import com.danga.MemCached.SockIOPool;

public class MemcachedMgr {
	public static MemCachedClient cachedClient = null;

	public static boolean initMemcached() {
		String[] servers = {Config.memcachedSvrPort};
		SockIOPool pool = SockIOPool.getInstance();
		pool.setServers(servers);
		pool.setFailover(true);
		pool.setInitConn(10);
		pool.setMinConn(5);
		pool.setMaxConn(250);
		// pool.setMaintSleep( 30 );
		pool.setNagle(false);
		pool.setSocketTO(3000);
		pool.setAliveCheck(true);
		pool.initialize();
		
		cachedClient = new MemCachedClient();
		
		return true;
	}
	
}
